<?php

namespace Modules\Admin\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class PasswordRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'oldpassword'=>'required|between:6,20',
			'password'=>'required|between:6,20|confirmed',
        ];
    }
	public function messages ()
	{
		return [
			'oldpassword.required'=>'旧密码不能为空',
			'oldpassword.between'=>'密码长度在6-20位之间',
			'password.required'=>'新密码不能为空',
			'password.confirmed'=>'两次密码输入不一致',
			'password.between'=>'密码长度在6-20位之间',
		];
	}

	/**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }
}
